package com.ouc.pampas;

import java.io.Serializable;
import java.util.Set;
import java.util.regex.Pattern;
import com.ouc.openplatform.pampas.BaseUser;
public class ProtectedAuth
  implements Serializable
{
  private static final long serialVersionUID = 6649344563529265570L;
  private String pattern;
  private Pattern regexPattern;
  private Set<BaseUser.TYPE> types;
  private Set<String> roles;
  
  public String toString()
  {
    return "ProtectedAuth(pattern=" + getPattern() + ", regexPattern=" + getRegexPattern() + ", types=" + getTypes() + ", roles=" + getRoles() + ")";
  }
  
  public String getPattern()
  {
    return this.pattern;
  }
  
  public void setPattern(String pattern)
  {
    this.pattern = pattern;
  }
  
  public Pattern getRegexPattern()
  {
    return this.regexPattern;
  }
  
  public void setRegexPattern(Pattern regexPattern)
  {
    this.regexPattern = regexPattern;
  }
  
  public Set<BaseUser.TYPE> getTypes()
  {
    return this.types;
  }
  
  public void setTypes(Set<BaseUser.TYPE> types)
  {
    this.types = types;
  }
  
  public Set<String> getRoles()
  {
    return this.roles;
  }
  
  public void setRoles(Set<String> roles)
  {
    this.roles = roles;
  }
  
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ProtectedAuth)) {
      return false;
    }
    ProtectedAuth protectedAuth = (ProtectedAuth)o;
    if (!this.pattern.equals(protectedAuth.pattern)) {
      return false;
    }
    return true;
  }
  
  public int hashCode()
  {
    return this.pattern.hashCode();
  }
}
